home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 68.7z / BS1 part 68 / Type Smith v2.0 (1993)(Relog)[h SR][WB].7z / Type Smith v2.0 (1993)(Relog)[h SR][WB].adf / TSFiles / ts1hintsubr < prev    next >
Text File  |  1993-11-14  |  5KB  |  179 lines

  1. % Flex and hint replacement code for TypeSmith 2.0.
  2. % Copyright (c) 1987-1990 Adobe Systems Incorporated.
  3. /OtherSubrs 
  4. [systemdict /internaldict known
  5. {1183615869 systemdict /internaldict get exec
  6. /FlxProc known {save true} {false} ifelse}
  7. {userdict /internaldict known not {
  8. userdict /internaldict
  9. {count 0 eq
  10. {/internaldict errordict /invalidaccess get exec} if
  11. dup type /integertype ne
  12. {/internaldict errordict /invalidaccess get exec} if
  13. dup 1183615869 eq
  14. {pop 0}
  15. {/internaldict errordict /invalidaccess get exec}
  16. ifelse
  17. }
  18. dup 14 get 1 25 dict put
  19. bind executeonly put
  20. } if
  21. 1183615869 userdict /internaldict get exec
  22. /FlxProc known {save true} {false} ifelse}
  23. ifelse
  24. [
  25. systemdict /internaldict known not
  26. { 100 dict /begin cvx /mtx matrix /def cvx } if
  27. systemdict /currentpacking known {currentpacking true setpacking} if
  28. {
  29. systemdict /internaldict known {
  30. 1183615869 systemdict /internaldict get exec
  31. /$FlxDict known not { 
  32. 100 dict begin
  33. /mtx matrix def
  34. 1183615869 systemdict /internaldict get exec
  35. /$FlxDict currentdict put
  36. end} if
  37. 1183615869 systemdict /internaldict get exec /$FlxDict get begin
  38. } if
  39. grestore
  40. /exdef {exch def} def
  41. /dmin exch abs 100 div def
  42. /epX exdef /epY exdef
  43. /c4y2 exdef /c4x2 exdef /c4y1 exdef /c4x1 exdef /c4y0 exdef /c4x0 exdef
  44. /c3y2 exdef /c3x2 exdef /c3y1 exdef /c3x1 exdef /c3y0 exdef /c3x0 exdef
  45. /c1y2 exdef /c1x2 exdef /c2x2 c4x2 def /c2y2 c4y2 def
  46. /yflag c1y2 c3y2 sub abs c1x2 c3x2 sub abs gt def
  47. /PickCoords { 
  48. {c1x0 c1y0 c1x1 c1y1 c1x2 c1y2 c2x0 c2y0 c2x1 c2y1 c2x2 c2y2}
  49. {c3x0 c3y0 c3x1 c3y1 c3x2 c3y2 c4x0 c4y0 c4x1 c4y1 c4x2 c4y2}
  50. ifelse
  51. /y5 exdef /x5 exdef /y4 exdef /x4 exdef /y3 exdef /x3 exdef
  52. /y2 exdef /x2 exdef /y1 exdef /x1 exdef /y0 exdef /x0 exdef
  53. } def
  54. mtx currentmatrix pop 
  55. mtx 0 get abs .00001 lt mtx 3 get abs .00001 lt or
  56. {/flipXY -1 def}
  57. {mtx 1 get abs .00001 lt mtx 2 get abs .00001 lt or
  58. {/flipXY 1 def}
  59. {/flipXY 0 def}
  60. ifelse }
  61. ifelse
  62. /erosion 1 def 
  63. systemdict /internaldict known {
  64.  1183615869 systemdict /internaldict get exec dup 
  65. /erosion known
  66. {/erosion get /erosion exch def}
  67. {pop}
  68. ifelse
  69. } if
  70. yflag
  71. {flipXY 0 eq c3y2 c4y2 eq or
  72. {false PickCoords}
  73. {/shrink c3y2 c4y2 eq
  74. {0}{c1y2 c4y2 sub c3y2 c4y2 sub div abs} ifelse def
  75. /yshrink {c4y2 sub shrink mul c4y2 add} def
  76. /c1y0 c3y0 yshrink def /c1y1 c3y1 yshrink def
  77. /c2y0 c4y0 yshrink def /c2y1 c4y1 yshrink def
  78. /c1x0 c3x0 def /c1x1 c3x1 def /c2x0 c4x0 def /c2x1 c4x1 def
  79. /dY 0 c3y2 c1y2 sub round
  80. dtransform flipXY 1 eq {exch} if pop abs def
  81. dY dmin lt PickCoords
  82. y2 c1y2 sub abs 0.001 gt {
  83. c1x2 c1y2 transform flipXY 1 eq {exch} if 
  84. /cx exch def /cy exch def
  85. /dY 0 y2 c1y2 sub round dtransform flipXY 1 eq {exch}
  86. if pop def
  87. dY round dup 0 ne
  88. {/dY exdef }
  89. {pop dY 0 lt {-1}{1} ifelse /dY exdef}
  90. ifelse
  91. /erode PaintType 2 ne erosion 0.5 ge and def
  92. erode {/cy cy 0.5 sub def} if
  93. /ey cy dY add def 
  94. /ey ey ceiling ey sub ey floor add def 
  95. erode {/ey ey 0.5 add def} if 
  96. ey cx flipXY 1 eq {exch} if itransform exch pop
  97. y2 sub /eShift exch def
  98. /y1 y1 eShift add def /y2 y2 eShift add def /y3 y3
  99. eShift add def
  100. } if
  101. } ifelse
  102. }
  103. {flipXY 0 eq c3x2 c4x2 eq or
  104. {false PickCoords }
  105. {/shrink c3x2 c4x2 eq
  106. {0}{c1x2 c4x2 sub c3x2 c4x2 sub div abs} ifelse def
  107. /xshrink {c4x2 sub shrink mul c4x2 add} def
  108. /c1x0 c3x0 xshrink def /c1x1 c3x1 xshrink def
  109. /c2x0 c4x0 xshrink def /c2x1 c4x1 xshrink def
  110. /c1y0 c3y0 def /c1y1 c3y1 def /c2y0 c4y0 def /c2y1 c4y1 def
  111. /dX c3x2 c1x2 sub round 0 dtransform
  112. flipXY -1 eq {exch} if pop abs def
  113. dX dmin lt PickCoords
  114. x2 c1x2 sub abs 0.001 gt {
  115. c1x2 c1y2 transform flipXY -1 eq {exch} if
  116. /cy exch def /cx exch def 
  117. /dX x2 c1x2 sub round 0 dtransform flipXY -1 eq {exch} if pop def
  118. dX round dup 0 ne
  119. {/dX exdef}
  120. {pop dX 0 lt {-1}{1} ifelse /dX exdef}
  121. ifelse
  122. /erode PaintType 2 ne erosion .5 ge and def
  123. erode {/cx cx .5 sub def} if
  124. /ex cx dX add def
  125. /ex ex ceiling ex sub ex floor add def
  126. erode {/ex ex .5 add def} if
  127. ex cy flipXY -1 eq {exch} if itransform pop
  128. x2 sub /eShift exch def
  129. /x1 x1 eShift add def /x2 x2 eShift add def /x3 x3 eShift add def
  130. } if
  131. } ifelse
  132. } ifelse
  133. x2 x5 eq y2 y5 eq or
  134. {x5 y5 lineto }
  135. {x0 y0 x1 y1 x2 y2 curveto
  136. x3 y3 x4 y4 x5 y5 curveto}
  137. ifelse
  138. epY epX 
  139. }
  140. systemdict /currentpacking known {exch setpacking} if 
  141. /exec cvx /end cvx ] cvx
  142. executeonly
  143. exch
  144. {pop true exch restore} 
  145. systemdict /internaldict known not
  146. {1183615869 userdict /internaldict get exec
  147. exch /FlxProc exch put true}
  148. {1183615869 systemdict /internaldict get exec
  149. dup length exch maxlength eq
  150. {false} 
  151. {1183615869 systemdict /internaldict get exec
  152. exch /FlxProc exch put true}
  153. ifelse}
  154. ifelse}
  155. ifelse
  156. {systemdict /internaldict known
  157. {{1183615869 systemdict /internaldict get exec /FlxProc get exec}}
  158. {{1183615869 userdict /internaldict get exec /FlxProc get exec}}
  159. ifelse executeonly
  160. } if
  161. {gsave currentpoint newpath moveto} executeonly 
  162. {currentpoint grestore gsave currentpoint newpath moveto}
  163. executeonly 
  164. {
  165. systemdict /internaldict known not
  166. {pop 3}
  167. {1183615869 systemdict /internaldict get exec
  168. dup /startlock known
  169. {/startlock get exec}
  170. {dup /strtlck known
  171. {/strtlck get exec}
  172. {pop 3}
  173. ifelse}
  174. ifelse}
  175. ifelse
  176. } executeonly
  177. ]ND
  178.